package com.wiegand.content.overlay {
	import com.wiegand.Configuration;
	import com.wiegand.gui.navigation.FooterNavigation;
	import com.wiegand.gui.text.CssTextSprite;
	import com.wiegand.util.ColorRectangle;

	import flash.display.Sprite;

	/**
	 * @author gandy
	 */
	public class Footer extends Sprite {

		private var _background : Sprite;
		private var _copy : Sprite;
		private var _navigation : FooterNavigation;
		private var _xml : XMLList;
		private var _container : Sprite;

		public function Footer() {
		}
		
		public function init() : void {
			_xml = Configuration.getInstance().elements.footer;
			
			_container = new Sprite();
			_container.mouseEnabled = false,
			addChild(_container);
			
			_background = ColorRectangle.create(0x000000,.85,stage.stageWidth,20);
			_container.addChild(_background);

			_copy = CssTextSprite.create(String(_xml.copy), "footer" );
			_copy.x = Configuration.BORDER;
			_copy.y = int(_xml.copy.@y);
			_container.addChild(_copy);

			_navigation = new FooterNavigation(_xml.footerNavigation);
			_container.addChild(_navigation);
			_navigation.init();
			
			_container.y = stage.stageHeight - height - Configuration.BORDER;
		}

		public function resize():void {	
			_background.width = stage.stageWidth;	
			_navigation.resizeHandler();	
			_container.y = stage.stageHeight - height - Configuration.BORDER;
		}
	}
}
